<?php

/**
 * War form base class.
 *
 * @method War getObject() Returns the current form's model object
 *
 * @package    gamerstats
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseWarForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'red'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Clan_4'), 'add_empty' => false)),
      'blue'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Clan'), 'add_empty' => false)),
      'date'        => new sfWidgetFormDateTime(),
      'mode'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Mode'), 'add_empty' => false)),
      'event'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Event'), 'add_empty' => false)),
      'description' => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'red'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Clan_4'))),
      'blue'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Clan'))),
      'date'        => new sfValidatorDateTime(array('required' => false)),
      'mode'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Mode'))),
      'event'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Event'))),
      'description' => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('war[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'War';
  }

}
